package com.tanhua.dubbo.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.dubbo.mappers.AnnouncementsMapper;
import com.tanhua.model.domain.Announcement;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

@DubboService
public class AnnouncementsApiImpl implements AnnouncementsApi{
    @Autowired
    private AnnouncementsMapper mapper;

    /**
     * 查询所有公告
     * @param page
     * @param pagesize
     * @return
     */
    @Override
    public Page<Announcement> findAllAnnouncements(Integer page, Integer pagesize) {
        Page<Announcement> page1 = new Page<>(page,pagesize);
        return mapper.selectPage(page1, null);
    }
}